﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using QuanLyBaoHiem.Libs;

namespace QuanLyBaoHiem.App_Code.Logic
{
    class HuyenLogic
    {
        DataService ds = new DataService();

        /// <summary>
        /// Lấy toàn bộ danh sách huyen
        /// </summary>
        /// <returns></returns>
        public DataTable LayDanhSachBangHuyen()
        {
            return ds.DocHetBang("HUYEN");
        }

        public DataTable LayDanhSachBangHuyenTheoTinh(string strMaTinh)
        {
            string sql = "SELECT * FROM HUYEN WHERE MaTinh = '" + strMaTinh + "'";
            return ds.Doc_Bang(sql);
        }

        /// <summary>
        /// Lấy cấu trúc bảng
        /// </summary>
        /// <returns></returns>
        public DataTable LayCauTrucBangHuyen()
        {
            return ds.DocCauTrucBang("HUYEN", "MaHuyen");
        }
    }
}
